package com.team1.supervend.domain;

public class ReceiptPrinter {
	Float totals = 0.0f;
	int items = 0;
	public ReceiptPrinter(){}
	
	public void printReciept(SelectedItem item){
		int q = item.quantity;
		String s = item.description.getDescription();
		Float c = item.getSubtotal().get();
		total(c);
		item(q);
		System.out.format("qty(%d):", q);
		System.out.print(" " + s);
		System.out.format("  $%.2f\n", c);	
	}

	public void receiptTotals(){
		System.out.format("Number of items purchased: %d", items);
		System.out.format("  Total: $%.2f\n", totals);
		
	}

	public void total(Float total){
		totals = totals + total;
	}
	
	public void item(int item){
		items = items + item;
	}
}
